package com.codeape.number.ui;

import android.app.Activity;
import android.content.res.Configuration;
import android.os.Bundle;

import androidx.core.content.ContextCompat;
import androidx.databinding.DataBindingUtil;

import com.codeape.number.R;
import com.codeape.number.base.mvvm.command.Command;
import com.codeape.number.databinding.ActivityHelpBinding;
import com.codeape.number.util.StatusBarUtil;

/**
 * 帮助页
 *
 * @author LiuPeiming
 * Created at old
 */
public class HelpActivity extends Activity {

    ActivityHelpBinding mBinding = null;

    /**
     * 回退
     */
    public Command onBackCommand = new Command(this::finish);

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        //判断设备是否处于深色模式
        if ((getApplicationContext().getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_YES) != 0) {
            //设置状态栏黑底白字
            StatusBarUtil.changeTitleBarColor(this, ContextCompat.getColor(this, R.color.background));
            StatusBarUtil.setDarkMode(this);
        } else {
            //设置状态栏白底黑字
            StatusBarUtil.changeTitleBarColor(this, ContextCompat.getColor(this, R.color.background));
            StatusBarUtil.setLightMode(this);
        }

        mBinding = DataBindingUtil.setContentView(this, R.layout.activity_help);
        mBinding.setActivity(this);
    }

}